<?php

namespace common\models\patient;

use Yii;

/**
 * This is the model class for table "{{%patient_order}}".
 *
 * @property int $id
 * @property int $patient_id 患者ID
 * @property int $order_time 预约时间
 * @property int $shop_id 门店ID【shop.id】
 * @property int $treatment_project_id 项目ID
 * @property string $remark 备注
 * @property int $status 状态【1已预约(等待到院)、2到院、3过期】
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 */
class PatientOrder extends \common\models\base\BaseModel
{
    const STATUS_WAIT = 1;
    const STATUS_ARRIVE = 2;
    const STATUS_EXPIRED = 3;

    public static $statuss = [
        self::STATUS_WAIT => '已预约',
        self::STATUS_ARRIVE => '到院',
        self::STATUS_EXPIRED => '已过期',
    ];

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%patient_order}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['patient_id', 'order_time', 'shop_id', 'treatment_project_id', 'status', 'created_at', 'updated_at'], 'integer'],
            [['remark'], 'string', 'max' => 512],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'patient_id' => '患者ID',
            'order_time' => '预约时间',
            'shop_id' => '门店ID【shop.id】',
            'treatment_project_id' => '项目ID',
            'remark' => '备注',
            'status' => '状态【1已预约(等待到院)、2到院、3过期】',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
        ];
    }
}
